<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:c="http://java.sun.com/jsp/jstl/core" >
   <head>
   <meta http-equiv="refresh" content="1" />
  </head> 
    <ui:composition template="/templates/default/template.xhtml">
    	<ui:define name="body">
    	
    	<h:panelGrid columns="1" style="margin-left:5px;width:100%">
    	<!--  tieu de -->
    	<h:panelGrid columns="3" styleClass="columPanelbaritemTitle">
			<h:graphicImage value="/templates/default/images/left-heading_01.jpg" style="margin-left:-4px;margin-bottom:0px"></h:graphicImage>
	  		<h:outputText value="Xem duyệt, yêu cầu" styleClass="panelbaritemTitle"></h:outputText>
			<h:graphicImage value="/templates/default/images/left-heading_03.jpg"></h:graphicImage>
	  	</h:panelGrid>
	  	<!-- ket thuc tieu de -->
		<!-- phan noi dung phia duoi -->
    	<h:panelGrid columns="1" styleClass="panelGridBody">
    			<!-- Bat dau noi dung ben trong -->
		  <h:form>
		    <rich:panel style="background:#FFFFFF">
		    	<h:panelGrid columns="2" style="margin-left:10px;">
		    	    <h:outputText></h:outputText>
					<h:outputText id="idError" value="#{table.error}" style=" color: red;"></h:outputText>
					<h:outputText ></h:outputText>		    		
		    		<h:inputHidden value="#{table.id}"></h:inputHidden>
					<h:outputText ></h:outputText>		    		
		    		<h:inputHidden value="#{table.flag}"></h:inputHidden>
		    		<h:outputText  value="Người yêu cầu:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText  disabled="true" value="#{table.userName}" styleClass="Input" id="idName" >
					</h:inputText>	
		    		<h:outputText  value="Số HC/Mã đoàn:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText disabled="true" value="#{table.soHC_Madoan}" styleClass="Input"></h:inputText>		    		
		    		<h:outputText value="Thao tác:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText disabled="true" value="#{table.thaoTac}" styleClass="Input"></h:inputText>		    		
		    		<h:outputText  value="Lý do:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText disabled="true" value="#{table.lydo}" styleClass="Input"></h:inputText>		    		
		    		<h:outputText  value="Ngày yêu cầu:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText disabled="true" value="#{table.ngayYeuCau}" styleClass="Input"></h:inputText>
					<h:outputText  value="Đã khóa:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText disabled="true"  value="#{table.daKhoa}" styleClass="Input"></h:inputText>
		    		
		    	<!-- action -->	
		    	</h:panelGrid>
			    	<h:panelGrid columns="2" style="margin-left:160px;margin-top:10px">
			    	<a4j:commandButton disabled="false" value="Lưu" styleClass="Button" action="#{table.save}" 
			    	 onclick="if(!confirm('Bạn có muốn lưu ?')) {return false;}" reRender="idError">
			    	 </a4j:commandButton>
			        <a4j:commandButton  value="Reset" styleClass="Button" action="#{table.reset}"></a4j:commandButton>
			       </h:panelGrid>
		       <!-- ket thuc action -->
			 </rich:panel>
		  </h:form>
			<!-- Ket thuc phan noi dung ben trong -->
			
			<!-- Bat dau table -->
			<!-- 	<rich:panel style="background:none"> -->
			<h:form>
			
					<h:dataTable id="list" value="#{table.tables}" var="T" 
								columnClasses="column" headerClass="TableHeader" rowClasses="ROW1,ROW2" footerClass="TableFooter" 
					       style="width:100%; margin-left:0px;margin-top: 10px" cellspacing="1px;" rows="10">
						<h:column >
							<f:facet name="header">
								<h:outputText value="STT"></h:outputText>
							</f:facet>
							<h:outputText value="#{T.stt}"></h:outputText>
							<f:facet name="footer">
								<rich:spacer></rich:spacer>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Người yêu cầu"></h:outputText>
							</f:facet>
							<h:outputText value="#{T.userName}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Số HC/Mã đoàn"></h:outputText>
							</f:facet>
							<h:outputText value="#{T.soHC_Madoan}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Ngày yêu cầu"></h:outputText>
							</f:facet>
							<h:outputText value="#{T.ngayYeuCau}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Khóa"></h:outputText>
							</f:facet>
							<h:outputText value="#{T.daKhoa}"></h:outputText>
						</h:column>
						
						<h:column>
							<f:facet name="header">
								<h:outputText value="Duyệt" ></h:outputText>
							</f:facet>
							<a4j:commandLink title="Duyệt" action="#{table.xemThongTin}">
								<h:graphicImage  width="30" height="25" value="/quantri/duyetyeucau/image/edit_page_v3.gif"></h:graphicImage>
								<f:param name="id" value="#{T.id}" />
								<f:param name="flag" value="duyet" />
							</a4j:commandLink>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Mở khóa"></h:outputText>
							</f:facet>
							 <a4j:commandLink title="Mở khóa" action="#{table.xemThongTin}">
							 	<h:graphicImage width="30" height="20" value="/quantri/duyetyeucau/image/unlock.gif"></h:graphicImage>
							 	<f:param name="id" value="#{T.id}" />
								<f:param name="flag" value="moKhoa" />
							 </a4j:commandLink>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Khóa"></h:outputText>
							</f:facet>
							 <a4j:commandLink title="Khóa" action="#{table.xemThongTin}">
							 	<h:graphicImage height="20" width="28" value="/quantri/duyetyeucau/image/lock_v2.gif"></h:graphicImage>
							 	<f:param name="id" value="#{T.id}" />
								<f:param name="flag" value="khoa" />
							 </a4j:commandLink>
						</h:column>
					</h:dataTable>
						<!-- phan trang -->
						<rich:datascroller align="right"  for="list" maxPages="5" />
						<!-- ket thuc phan trang -->
				</h:form>
				<!-- </rich:panel> -->
				<!--  Ket thuc table -->
    		</h:panelGrid>   
    		<!-- Ket thuc phan noi dung phia duoi --> 					
    	</h:panelGrid>
    	</ui:define>
    </ui:composition> 
    
</html>







